package com.linq.cool.beauty.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.linq.cool.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: yqlin
 * @Date: 2021/2/3 19:27
 * @Description: 退费记录表
 * @Version: 1.0.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "beauty_refund")
public class BeautyRefund extends BaseEntity {
    /**
     * 退费id
     */
    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    /**
     * 充值记录订单id beauty_top_up
     */
    @TableField(value = "top_up_id")
    private String topUpId;

    /**
     * 退费金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 客户(会员)id(冗余处理)
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableField(value = "member_id")
    private Long memberId;

    /**
     * 客户(会员)手机号(冗余处理)
     */
    @TableField(value = "member_phone")
    private String memberPhone;

    /**
     * 客户(会员)真实姓名(冗余处理)
     */
    @TableField(value = "member_real_name")
    private String memberRealName;

    /**
     * 订单状态0未退费  1 退费成功 2退费失败  字典表 beauty_refund_status
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 退费类型0现金1支付宝 2微信  字典表	beauty_refund_type
     */
    @TableField(value = "back_type")
    private Integer backType;

    /**
     * 0: 全额退款 1: 部分退款
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 退费时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "back_time")
    private Date backTime;

    /**
     * 退费交易ID
     */
    @TableField(value = "back_platform_id")
    private String backPlatformId;
}